
var report = new Vue({
    el:'#report',
    data:{
        /*查询第一部分的定义*/
        ruleForm:{
            name:'',
            date1:'',
            date2:''
        },

        activeName:'0',
        dialogFormVisible:false,

        option : {
            title : {
                text: '该客户一年内消费信息图',
                subtext: '此数据仅在博望演示使用不代表真实数据'
            },
            tooltip : {
                trigger: 'axis'
            },
            legend: {
                data:['此客户消费金额','平均消费金额']
            },
            toolbox: {
                show : true,
                feature : {
                    mark : {show: true},
                    dataView : {show: true, readOnly: false},
                    magicType : {show: true, type: ['line', 'bar']},
                    restore : {show: true},
                    saveAsImage : {show: true}
                }
            },
            calculable : true,
            xAxis : [
                {
                    type : 'category',
                    data : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
                }
            ],
            yAxis : [
                {
                    type : 'value'
                }
            ],
            series : [
                {
                    name:'此客户消费金额',
                    type:'bar',
                    data:[2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],
                    markPoint : {
                        data : [
                            {type : 'max', name: '最大值'},
                            {type : 'min', name: '最小值'}
                        ]
                    },
                    markLine : {
                        data : [
                            {type : 'average', name: '平均值'}
                        ]
                    }
                },
                {
                    name:'平均消费金额',
                    type:'bar',
                    data:[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
                    markPoint : {
                        data : [
                            {name : '年最高', value : 182.2, xAxis: 7, yAxis: 183, symbolSize:18},
                            {name : '年最低', value : 2.3, xAxis: 11, yAxis: 3}
                        ]
                    },
                    markLine : {
                        data : [
                            {type : 'average', name : '平均值'}
                        ]
                    }
                }
            ]
        },
        optionPie : {
            title : {
                text: '该客户各项修车服务情况',
                subtext: '此数据仅在博望演示使用不代表真实数据',
                x:'center'
            },
            tooltip : {
                trigger: 'item',
                formatter: "{a} <br/>{b} : {c} ({d}%)"
            },
            legend: {
                orient : 'vertical',
                x : 'left',
                data:['洗车','加机油','换轮胎','发动机故障','补漆']
            },
            toolbox: {
                show : true,
                feature : {
                    mark : {show: true},
                    dataView : {show: true, readOnly: false},
                    magicType : {
                        show: true,
                        type: ['pie', 'funnel'],
                        option: {
                            funnel: {
                                x: '25%',
                                width: '50%',
                                funnelAlign: 'left',
                                max: 1548
                            }
                        }
                    },
                    restore : {show: true},
                    saveAsImage : {show: true}
                }
            },
            calculable : true,
            series : [
                {
                    name:'服务情况',
                    type:'pie',
                    radius : '55%',
                    center: ['50%', '60%'],
                    data:[
                        {value:335, name:'补漆'},
                        {value:310, name:'发动机故障'},
                        {value:234, name:'换轮胎'},
                        {value:135, name:'加机油'},
                        {value:1548, name:'洗车'}
                    ]
                }
            ]
        }

},
    methods: {
        /*更多按钮的单击方法*/
        activeClick: function () {
            var _this = this;
            if (_this.activeName == '0' || _this.activeName == '2') {
                _this.activeName = '1';

            } else {
                _this.activeName = '2';


            }
        },
    },
    created:function(){
        debugger
        var _this = this;

    }
});
// 折线柱状图
var myChart = echarts.init(document.getElementById('lineAndBar'));
myChart.setOption(report.option);
// 饼状图
var myChartPie = echarts.init(document.getElementById('pie'));
myChartPie.setOption(report.optionPie);

